import dt from '@dt/dt'
import Opt from '@/components/dt/info/Opt.js'
import ruleOpt from '@/biz/option/rule.js'

class CompanyOpt extends Opt {
  constructor(info) {
    super(info)
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        title: '所属组织',
        key: 'companyName',
        text: {}
      },
      {
        title: '案场名称',
        key: 'housesName',
        text: {}
      },
      {
        title: '佣金单名称',
        key: 'commissionName',
        text: {}
      },
      {
        title: '结算月份',
        key: 'commissionMonth',
        text: {}
      },
      {
        title: '入账公司',
        key: 'accountingCompany',
        select: {
          options: dt.dictInfo().accountingCompany.map((i) => ({
            key: i.value,
            value: i.value
          })),
          filterable: true
        },
        rules: [ruleOpt.required('请选择入账公司')]
      }
    ]
  }
}

export default CompanyOpt
